fix(delete): always print warnings when file deletions fail
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 15 May 2025 10:04:43 +0000 (12:04 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 30 May 2025 07:07:46 +0000 (07:07 +0000)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/propagatorjobs.cpp

index 6711685a31a3fc240683106e3df03b990374f686..072ccbfd7023b26f19412a0ed7f8e3e0f60b6bbc 100644 (file)
@@ -110,6 +110,7 @@ void PropagateLocalRemove::start()
     if (_moveToTrash && propagator()->syncOptions()._vfs->mode() != OCC::Vfs::WindowsCfApi) {
         if ((QDir(filename).exists() || FileSystem::fileExists(filename))
             && !FileSystem::moveToTrash(filename, &removeError)) {
+            qCWarning(lcPropagateLocalRemove()) << "move to trash failed" << filename << removeError;
             done(SyncFileItem::NormalError, tr("Temporary error when removing local item removed from server."), ErrorCategory::GenericError);
             return;
         }
@@ -127,6 +128,7 @@ void PropagateLocalRemove::start()
                 const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite};
 
                 if (!FileSystem::remove(filename, &removeError)) {
+                    qCWarning(lcPropagateLocalRemove()) << "remove failed" << filename << removeError;
                     done(SyncFileItem::NormalError, tr("Temporary error when removing local item removed from server."), ErrorCategory::GenericError);
                     return;
                 }